package com.example.whatrubbish.vo;

import com.example.whatrubbish.model.Commodity;
import com.example.whatrubbish.model.Order;
import com.example.whatrubbish.model.ReceiverAddress;
import com.example.whatrubbish.model.User;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
public class OrderDetailVO extends Order implements Serializable {
    User user;

    ReceiverAddress receiverAddress;

    Commodity commodity;

    public OrderDetailVO(User user, ReceiverAddress receiverAddress, Commodity commodity, Order order) {
        this.user = user;
        this.receiverAddress = receiverAddress;
        this.commodity = commodity;
        this.setId(order.getId());
        this.setUserId(order.getUserId());
        this.setCommodityId(order.getCommodityId());
        this.setStatus(order.getStatus());
        this.setCreateTime(order.getCreateTime());
        this.setDeliveryTime(order.getDeliveryTime());
        this.setEndTime(order.getEndTime());
        this.setCourierNumber(order.getCourierNumber());
    }
}
